package com.nthinkers.sabq.activities;

import android.os.Bundle;

import com.nthinkers.sabq.R;

public class SplashActivity extends BaseActivity {

	protected boolean _active = true;
	protected int _splashTime = 2000;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.screen_splash);

		Thread splashTread = new Thread() {
			@Override
			public void run() {
				try {
					int waited = 0;
					while (_active && (waited < _splashTime)) {
						sleep(100);
						if (_active) {
							waited += 100;
						}
					}
				} catch (InterruptedException e) {
					// do nothing
				} finally {
					finish();
					goToHomeScreen();

				}
			}
		};
		splashTread.start();
	}
}
